package com.dubbox.controller;

import com.dubbox.api.GreetingService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("health")
public class TestController {

    // 依赖的注解
    @DubboReference
    GreetingService greetingService;

    @GetMapping("/test")
    public String test() {
        return greetingService.sayHello("this is from dubbo consumer");
    }


    @GetMapping("/add")
    public Integer add() {
        return greetingService.add(10, 30);
    }
}
